import cn.edu.zut.cs.Business.SaleService;
import cn.edu.zut.cs.Model.Info;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.Rollback;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
import org.testng.annotations.Test;

import static org.testng.Assert.assertTrue;

@ContextConfiguration("classpath*:database-context.xml")
public class Beantest extends AbstractTestNGSpringContextTests {
    @Autowired
    Info info;
    @Autowired
    SaleService service;

    @Test
    @Rollback(false)
    public void beantest(){
        info.setId("2018");
        assertTrue(info!=null);

    }
    @Test
    public void insert(){
        info.setId("20180806471007");
        info.setName("aaa");
        info.setHealth("ok");
        info.setDate("2020.5.59");
        service.insert(info);
    }
}
